package cn.csc.module.pay.dal.mysql.funddetailslog;

import java.util.*;

import cn.csc.framework.common.pojo.PageResult;
import cn.csc.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.csc.framework.mybatis.core.mapper.BaseMapperX;
import cn.csc.module.pay.dal.dataobject.funddetailslog.PayFundDetailsLogDO;
import org.apache.ibatis.annotations.Mapper;
import cn.csc.module.pay.controller.admin.funddetailslog.vo.*;

/**
 * 用户资金收支明细表记录 Mapper
 *
 * @author 华南城
 */
@Mapper
public interface PayFundDetailsLogMapper extends BaseMapperX<PayFundDetailsLogDO> {

    default PageResult<PayFundDetailsLogDO> selectPage(PayFundDetailsLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PayFundDetailsLogDO>()
                .eqIfPresent(PayFundDetailsLogDO::getAppUserId, reqVO.getAppUserId())
                .eqIfPresent(PayFundDetailsLogDO::getMerchantId, reqVO.getMerchantId())
                .eqIfPresent(PayFundDetailsLogDO::getTradeAmount, reqVO.getTradeAmount())
                .eqIfPresent(PayFundDetailsLogDO::getOrderId, reqVO.getOrderId())
                .eqIfPresent(PayFundDetailsLogDO::getJzbOrderId, reqVO.getJzbOrderId())
                .eqIfPresent(PayFundDetailsLogDO::getTradeType, reqVO.getTradeType())
                .betweenIfPresent(PayFundDetailsLogDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PayFundDetailsLogDO::getId));
    }

    default List<PayFundDetailsLogDO> selectList(PayFundDetailsLogExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<PayFundDetailsLogDO>()
                .eqIfPresent(PayFundDetailsLogDO::getAppUserId, reqVO.getAppUserId())
                .eqIfPresent(PayFundDetailsLogDO::getMerchantId, reqVO.getMerchantId())
                .eqIfPresent(PayFundDetailsLogDO::getTradeAmount, reqVO.getTradeAmount())
                .eqIfPresent(PayFundDetailsLogDO::getOrderId, reqVO.getOrderId())
                .eqIfPresent(PayFundDetailsLogDO::getJzbOrderId, reqVO.getJzbOrderId())
                .eqIfPresent(PayFundDetailsLogDO::getTradeType, reqVO.getTradeType())
                .betweenIfPresent(PayFundDetailsLogDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PayFundDetailsLogDO::getId));
    }

}
